import java.awt.BorderLayout;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;

public class MainFrame extends JFrame implements Observer {

    private JLabel m_label;
    private JTextArea m_textArea;

    public MainFrame() {
        super("Fichier notifier");

        m_label = new JLabel("Derniere ligne du fichier :");
        m_textArea = new JTextArea(8, 60);
        setLayout(new BorderLayout());

        add(m_label, BorderLayout.NORTH);
        add(m_textArea, BorderLayout.CENTER);

        setLocationRelativeTo(null);
    }

    public void update(Observable _arg0, Object _arg1) {
        String ligne = "";

        if (_arg1 instanceof String) {
            ligne = (String) _arg1;
            m_textArea.setText(ligne);
        }
    }
}
